#!/usr/bin/perl

require './dftcfg-lib.pl';

my ($err_msg, $out, $err_no, $log_ev, $log_msg, $log_lev, $sv_mount_dev);

#&ReadParse();

&ReadParseMime();

open(UPLOAD, ">/tmp/cfgtmp.gz");
print UPLOAD $in{'inputfile'};
close(UPLOAD);

$out1 = `tar xfvz /tmp/cfgtmp.gz -C /tmp/`;
$out2 = `rm -f /tmp/cfgtmp.gz`;
$out3 = `rm -rf /sysvol/etc`;
$out4 = `cp -a /tmp/sysvol/etc /sysvol/`;
$out5 = `rm -rf /tmp/sysvol/`;
&header($text{'upload_title'}, "", "index", 0, 1);
print $text{'rst_success'};
&footer("", $text{'index'});


goto SUCC_OUT;

ERROR_OUT:
&error_setup($text{'error_title'});
&error($err_msg);


SUCC_OUT:
$out = `shutdown -r now`;
